import React, { useState } from 'react';
import { Button } from 'antd';
import {connect} from 'react-redux'
import {addCount} from '../redux/actions/studentAction'
export default connect(({ studentReducer }) => ({
    count: studentReducer.count
}))(function(props){
    const click = () => {
        props.dispatch(addCount(props.count + 1));
    }
    return (
        <div>
            <Button type='primary' onClick={click}>计数</Button>
            <label>
                {props.count}
            </label>
        </div>
    )
})